package oktx.dubbo.terminator;

import oktx.terminator.TransactionTerminatorBean;
import oktx.config.LocalTxTerminator;

/**
 * Created by dave on 18-5-19 下午5:20.
 * 处理提交或回滚分支事务的Dubbo服务类
 */
public class DubboTxTerminatorService implements TransactionTerminatorBean {
    private LocalTxTerminator terminator;

    public DubboTxTerminatorService(LocalTxTerminator terminator) {
        this.terminator = terminator;
    }

    @Override
    public void rollback(String xid) {
        terminator.rollback(xid, false);
    }

    @Override
    public void commit(String xid) {
        terminator.commit(xid, false);
    }
}
